<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="dgg" uri="/dgg-tags" %>
<div class="layer-warp">
    <c:if test="${!empty order}">
        <div>
            <span style="color: red;background: #FAEBD7;padding:8px;margin:8px;border-radius:5px">
                跨事业部移交：将订单及订单下的所有生产订单移交到同业态下的其他事业部进行处理，订单生产所属发生变化。
            </span>
            <table class="titleTable add-table" style="margin-top: 20px">
                <tbody>
                <input type="hidden" id="orderId" value="${order.orderId}">
                <tr>
                    <th><span class="form-label ">客户名称：</span></th>
                    <td>${order.customerName}
                        <span>(</span>
                        <dgg:ennumber number="${order.customerPhone}"/>
                        <span>)</span>
                    </td>
                    <th><span class="form-label ">订单编号：</span></th>
                    <td>${order.orderNo}</td>
                </tr>
                <tr>
                    <th><span class="form-label ">办理业务：</span></th>
                    <td>${productNames}</td>
                    <th><span class="form-label ">签单商务：</span></th>
                    <td>${order.signUserName}</td>
                </tr>
                <tr>
                    <th><span class="form-label ">签单时间：</span></th>
                    <td><fmt:formatDate value="${order.signDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <th><span class="form-label ">订单金额：</span></th>
                    <td>${order.money}元</td>
                </tr>
                </tbody>
            </table>
        </div>
    </c:if>

    <c:if test="${!empty list}">
        <div class="popups-info" id="allotBox">
            <table class="layui-table">
                <thead>
                <tr>
                    <th>生产订单编号</th>
                    <th>生产订单状态</th>
                    <th>办理业务</th>
                    <th>最新节点</th>
                    <th>流程人员</th>
                    <th>所在部门</th>
                </tr>
                </thead>
                <tbody>
                    <c:forEach items="${list}" var="o">
                        <tr>
                            <td>${o.scProductOrderNo}</td>
                            <td>${o.status}</td>
                            <td>${o.procuctName}</td>
                            <td>${o.lastestEndNodeName}</td>
                            <td>${o.flowUserName}</td>
                            <td>${o.flowUserOrgName}</td>
                        </tr>
                    </c:forEach>

                </tbody>
            </table>
        </div>
    </c:if>



    <div class="distribPersonel popups-info" id="allotBox">
        <table class="add-table form-table">
            <tr>
                <th><span class="form-label required">选择移交事业部：</span></th>
                <td>
                    <div class="title-list">
                        <div class="layui-inline select2-inline">
                            <div class="layui-input-inline">
                                <input type="text" style="width: 180px" class="input-style" autocomplete="off"
                                       id="selectTreeAddRessId" name="selectTreeAddRessId"
                                       data-id="" data-orgid="" placeholder="请选择最下级的所属事业部"/>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<script src="${rootUrl}/static/js/zzsc/common/sc_chooseUser.js?v=${version}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(function(){
    $('#selectTreeAddRessId').selectTree({
        check: false,   //默认为false，单选；设置为 true ，为多选
        search: true,
        parentIsCheck: false,
        url:  cmsBaseUrl + "/api/cms/org/v1/find_all_parent_orgs.do?level=ORG_LEVEL_1&isFilterAB=1",//请求路 径
        form: true,
        idName: 'orgId',
        idKey: "id",//指定id
        pIdKey: "pId",//指定pId
        dataFilter: function (treeId, parentNode, responseData) {
            console.log(responseData);
            return responseData.data;
        }

    });
    //初始化下拉数据
});
</script>